<?php
/**************************
 * Created on Jan 22, 2011
 * By: Jos Pape
 * info: jospape@hotmail.com
 */
include_once "../../../common.php";

$query = "SELECT * FROM Bugs WHERE ID = '".str_replace("'","",$_GET['bug'])."'";
$result = $_MySQL->runQuery($query);
$row = mysql_fetch_assoc($result);
?>
<form action="?bug=<?=$_GET['bug'];?>" method="post">
	<select name="userID">
		<?php
		$sub_query = "SELECT * FROM Users ORDER BY Firstname, Lastname";
		$sub_result = $_MySQL->runQuery($sub_query);
		while($sub_row = mysql_fetch_assoc($sub_result))
		{
			$selected = "";
			if($row['InBehandelingBij'] == $sub_row['ID'])
				$selected = ' selected="selected" ';
			?>
			<option <?=$selected;?> value="<?=$sub_row['ID'];?>"><?=$sub_row['Firstname'].' '.$sub_row['Lastname'];?></option>
			<?php
		}			
		?>
	</select>
	<input type="submit" value=" Opslaan " />
	<input type="hidden" name="bugid" value="<?=$_GET['bug'];?>" />
	<input type="hidden" name="action" value="updateBehandeling" />
</form>